package com.ethank.enums.ali;

import com.ethank.entity.VoucherResponseVO;

import java.util.ArrayList;
import java.util.List;

/**
 * @author Administrator
 * 卷票
 * @Description type 1- input 文本 2-日期 3-时间
 */

public enum RollTicketBillEnum {
    TYPE("type", "类型", "", 1, false),
    TITLE("title", "标题", "", 1, false),
    INVOICECODE("invoiceCode", "发票代码", "", 1, true),
    INVOICENUMBER("invoiceNumber", "发票号码", "", 1, true),
    MACHINECODE("machineCode", "机器编号", "", 1, false),
    SELLERNAME("sellerName", "销售方名称", "", 1, false),
    SELLERTAXNUMBER("sellerTaxNumber", "销售方税号", "", 1, false),
    PURCHASERNAME("purchaserName", "购买方名称", "", 1, false),
    PURCHASERTAXCODE("purchaserTaxCode", "购买方税号", "", 1, false),
    INVOICEDATE("invoiceDate", "开票日期", "", 2, false),
    CASHIER("cashier", "收款员", "", 1, false),
    TOTALAMOUNTINWORDS("totalAmountInWords", "合计金额(大写)", "", 1, false),
    TOTALAMOUNT("totalAmount", "合计金额(小写)", "", 1, false),
    CHECKCODE("checkCode", "校验码", "", 1, false),
    ITEMNAME("itemName", "项目", "", 1, false),
    QUANTITY("quantity", "数量", "", 1, false),
    UNITPRICE("unitPrice", "单价", "", 1, false),
    AMOUNT("amount", "金额", "", 1, false);

    private String key;
    private String label;
    private String value;
    private Integer type;
    private boolean require;

    RollTicketBillEnum() {
    }

    RollTicketBillEnum(String key, String label, String value, Integer type, boolean require) {
        this.key = key;
        this.label = label;
        this.value = value;
        this.type = type;
        this.require = require;
    }

    public static List<VoucherResponseVO> convertVoucher() {
        ArrayList<VoucherResponseVO> vos = new ArrayList<>();
        for (RollTicketBillEnum fieldEnum : RollTicketBillEnum.values()) {
            VoucherResponseVO vo = new VoucherResponseVO();
            vo.setKey(fieldEnum.getKey());
            vo.setLabel(fieldEnum.getLabel());
            vo.setType(fieldEnum.getType());
            vos.add(vo);
        }
        return vos;
    }

    public String getKey() {
        return key;
    }

    public void setKey(String key) {
        this.key = key;
    }

    public String getLabel() {
        return label;
    }

    public void setLabel(String label) {
        this.label = label;
    }

    public String getValue() {
        return value;
    }

    public void setValue(String value) {
        this.value = value;
    }

    public Integer getType() {
        return type;
    }

    public void setType(Integer type) {
        this.type = type;
    }

    public boolean isRequire() {
        return require;
    }

    public void setRequire(boolean require) {
        this.require = require;
    }
}
